home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / accounts / improved.sha / improved.shadow.h
C/C++ Source or Header  |  1995-01-30  |  3KB  |  112 lines

  1. /*
  2.  * A quick hack to make 16 character shadow passwords work on Linux.
  3.  * replace /usr/include/shadow.h with this file.  There are only two
  4.  * lines changed, and the original lines are still there, just commented
  5.  * out for reference.  If you get shadow-3.3.1, and the Linux patch, the
  6.  * configuration defaults to plain 8 character password truncation.  And
  7.  * if you define DOUBLE_SIZE in config.h, the compile fails because of
  8.  * two mismatched prototypes in shadow.h.  This fixes it.  I am using
  9.  * this on my system right now, and all normal and long length passwords
  10.  * are working fine, but I make no gaurantees for anyone else.
  11.  *
  12.  *                           Brandon
  13.  *                               photon@photon.usis.com
  14.  *
  15.  */
  16.  
  17.  
  18.  
  19. /*
  20.  * Copyright 1988, 1989, 1990, John F. Haugh II
  21.  * All rights reserved.
  22.  *
  23.  * Use, duplication, and disclosure prohibited without
  24.  * the express written permission of the author.
  25.  */
  26.  
  27. #ifndef _SHADOW_H
  28.  
  29. #define _SHADOW_H    1
  30. #include <features.h>
  31.  
  32. __BEGIN_DECLS
  33.  
  34. #include <gnu/types.h>
  35. #include <stdio.h>
  36. #include <pwd.h>
  37. #include <grp.h>
  38.  
  39. /*
  40.  * This information is not derived from AT&T licensed sources.  Posted
  41.  * to the USENET 11/88, and updated 11/90 with information from SVR4.
  42.  *
  43.  *    @(#)shadow.h    3.3    09:06:50    12/7/90
  44.  */
  45.  
  46. typedef __time_t sptime;
  47.  
  48. /*
  49.  * Shadow password security file structure.
  50.  */
  51.  
  52. struct spwd
  53. {
  54.   char *sp_namp;        /* login name */
  55.   char *sp_pwdp;        /* encrypted password */
  56.   sptime sp_lstchg;        /* date of last change */
  57.   sptime sp_min;        /* minimum number of days between changes */
  58.   sptime sp_max;        /* maximum number of days between changes */
  59.   sptime sp_warn;        /* number of days of warning before password
  60.                    expires */
  61.   sptime sp_inact;        /* number of days after password expires
  62.                    until the account becomes unusable. */
  63.   sptime sp_expire;        /* days since 1/1/70 until account expires */
  64.   unsigned long sp_flag;    /* reserved for future use */
  65. };
  66.  
  67. /*
  68.  * Shadow password security file functions.
  69.  */
  70.  
  71. extern void setspent __P ((void));
  72. extern void endspent __P ((void));
  73. /* extern struct spwd *sgetspent __P ((__const char *__string)); */
  74. extern struct spwd *sgetspent __P ((char *__string));
  75. extern struct spwd *fgetspent __P ((FILE *__fp));
  76. extern struct spwd *getspent __P ((void));
  77. /* extern struct spwd *getspnam __P ((__const char *__name)); */
  78. extern struct spwd *getspnam __P ((char *__name));
  79. extern int putspent __P ((__const struct spwd *__sp, FILE *__fp));
  80.  
  81. #define SHADOW "/etc/shadow"
  82.  
  83. /*
  84.  * Shadow group security file structure
  85.  */
  86.  
  87. struct    sgrp
  88. {
  89.   char *sg_name;        /* group name */
  90.   char *sg_passwd;        /* group password */
  91.   char **sg_adm;        /* group administator list */
  92.   char **sg_mem;        /* group membership list */
  93. };
  94.  
  95. /*
  96.  * Shadow group security file functions.
  97.  */
  98.  
  99. extern void setsgent __P ((void));
  100. extern void endsgent __P ((void));
  101. extern struct sgrp *sgetsgent __P ((__const char *__string));
  102. extern struct sgrp *fgetsgent __P ((FILE *__fp));
  103. extern struct sgrp *getsgent __P ((void));
  104. extern struct sgrp *getsgnam __P ((__const char *__str));
  105. extern int putsgent __P ((__const struct sgrp *_grp, FILE *__fp));
  106.  
  107. #define GSHADOW "/etc/gshadow"
  108.  
  109. __END_DECLS
  110.  
  111. #endif /* shadow.h */
  112.